### Programs
CC = gcc

### Options
PROGRAM = lparser
TESTPROGRAM = lptest
DEBUG = -ggdb
WARNING = -Wall
DELETE = /bin/rm -f
CCOPTIONS = ${DEBUG} ${WARNING}
PACKAGES = glib-2.0 gtk+-2.0 libglade-2.0
LIBS = `pkg-config --libs ${PACKAGES}`
CFLAGS = `pkg-config --cflags ${PACKAGES}`
OBJ = logicparser.o lp_graph.o
OBJAPP = main.o lp_app.o ${OBJ}
OBJTEST = lp_test.o ${OBJ}

all: ${OBJAPP}
	${CC} ${OBJAPP} -o ${PROGRAM} ${LIBS} ${CCOPTIONS}

test: ${OBJTEST}
	${CC} ${OBJTEST} -o ${TESTPROGRAM} ${LIBS} ${CCOPTIONS}

main.o: main.c
	${CC} main.c -c ${CFLAGS} ${CCOPTIONS}

lp_app.o: lp_app.c lp_app.h
	${CC} lp_app.c -c ${CFLAGS} ${CCOPTIONS}

lp_test.o: lp_test.c
	${CC} lp_test.c -c ${CFLAGS} ${CCOPTIONS}

logicparser.o: logicparser.c logicparser.h
	${CC} logicparser.c -c ${CFLAGS} ${CCOPTIONS}

lp_graph.o: lp_graph.c lp_graph.h
	${CC} lp_graph.c -c ${CFLAGS} ${CCOPTIONS}

#elimina arquivos inúteis
clean:
	${DELETE} *.o *~ ${PROGRAM} ${TESTPROGRAM}

doc:
	doxygen Doxyfile

